﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BLL.SysManage
{
    public class T_PUB_UNIALMATIAL
    {
        private readonly DALL.SysManage.T_PUB_UNIALMATIAL dal = new DALL.SysManage.T_PUB_UNIALMATIAL();
        public DataTable GetList(string strMonth, string strPrice)
        {
            string strWhere = "";
            if (strPrice == "")
            {
                if (strMonth != "")
                {
                    strWhere = string.Format(" where  u.month='{0}'", strMonth);
                }
            }
            else
            {
                strWhere = string.Format(" where  u.WeedPrice='{0}'", strPrice);
            }

            return dal.GetList(strWhere);
        }
        public DataTable getUList(string strMonth,string strPrice)
        {
            string strWhere = " where 1>0 ";
            if (strPrice!="")
            {
                strWhere = strWhere + string.Format(" and (u.month='{0}' or u.WeedPrice='{1}')", strMonth, strPrice);
            }
            else
            {
                strWhere = strWhere + string.Format(" and (u.month='{0}' or u.WeedPrice='' or u.WeedPrice is null )", strMonth);
            }
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int strid)
        {
            return dal.Delete(strid);
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.SysManage.T_PUB_UNIALMATIAL GetModel(int strid)
        {
            return dal.GetModel(strid);
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Model.SysManage.T_PUB_UNIALMATIAL model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.SysManage.T_PUB_UNIALMATIAL model)
        {
            return dal.Update(model);
        }
    }
}
